<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%
	String baseP = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ "/";
%>

<!doctype html>
<html>
  <head>
    
<title>违法查询</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link type="text/css" href="<c:url value='/resource/css/wechat-common.css'/>" rel="stylesheet"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="cleartype" content="on" />
<link rel="shortcut icon" href="/nocontent" />

<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width,user-scalable=no" />
<meta name="viewport" id="viewport" />

 <script type="text/javascript"
			  src="<c:url value='/resource/js/jquery-2.0.min.js'/>"></script>
<script src="<c:url value='/resource/js/common.js'/>" type="text/javascript"></script>
	<script type="text/javascript">
		function check(num){
			var rep=/^[\u4e00-\u9fa5]{1}[A-Z]{1}[A-Z_0-9]{5}$/;
			var rep_num = /[a-z_A-Z_0-9]{7}/;
			var CarId_one = $("#idcard_case").val().trim();
			var CarId_two = $("#accept_case").val().trim();
			var drive_license = $("#drive_license").val().trim();
			var fn = $("#fn").val().trim();
			var firnull = "车牌号不能为空";
			var secnull = "车架号不能为空";
			var firformet = "车牌号格式不正确";
			var secformet = "请输入车架号后7位";
			if(1 == num){
				firnull = "驾驶证编号不能为空";
				secnull = "档案编号不能为空";
				firformet = "驾驶证编号格式不正确";
				secformet = "请输入档案编号后6位";
				if(drive_license == null || drive_license == ""){
					toast(firnull, 1500);
					return false;
				}else if(fn == null || fn == ""){
					toast(secnull, 1500);
					return false;
				}else if(!rep.test(CarId_one)){
					toast(firformet, 1500);
					return false;
				}else if(!rep_num.test(CarId_two)){
					toast(secformet, 1500);
					return false;
				}else{
					window.location.href="<c:url value='/police/gotoWZCXInfo'/>?CarId_one="+escape(encodeURIComponent(CarId_one))+"&CarId_two="+CarId_two+"&drive_license="+drive_license+"&fn="+fn+"&carordriver="+num;
				}

			}else{
				if(CarId_one == null || CarId_one == ""){
					toast(firnull, 1500);
					return false;
				}else if(CarId_two == null || CarId_two == ""){
					toast(secnull, 1500);
					return false;
				}else if(!rep.test(CarId_one)){
					toast(firformet, 1500);
					return false;
				}else if(!rep_num.test(CarId_two)){
					toast(secformet, 1500);
					return false;
				}else{
					window.location.href="<c:url value='/police/gotoWZCXInfo'/>?CarId_one="+escape(encodeURIComponent($("#idcard_case").val()))+"&CarId_two="+$("#accept_case").val()+"&carordriver="+num;
				}
			}
		}
		
		function hiden(){
			$(".toast").hide();
		}
		
		function changetab(num){
			if(1 == num){
				$("#wzcx_car").css("display","block");
				$("#wzcx_drive").css("display","none");
				$("#tapbtn_1").css("background","#BBD6F2");
				$("#tapbtn_2").css("background","#FFFFFF");
			}
			if(2 == num){
				$("#wzcx_car").css("display","none");
				$("#wzcx_drive").css("display","block");
				$("#tapbtn_1").css("background","#FFFFFF");
				$("#tapbtn_2").css("background","#BBD6F2");
			}
		}
	</script>
<style type="text/css">
  .main {
            font-size: 1.6em;
            margin: 8px;
        }
        .main .form {
            height: 50px;
            line-height: 50px;
            border: 1px solid #dddddd;
            width: 100%;
            border-top: 0;
        }
        #wzcx_car {
        	border-top: 1px solid #dddddd;
        	margin: 0 8px;
        }
        #wzcx_drive {
        	border-top: 1px solid #dddddd;
        	margin: 0 8px;
        }
        
        .main .boder-top {
            border-top: 1px solid #dddddd
        }
        .border_top_radius {
            border-top-left-radius: 3px;
            border-top-right-radius: 3px;
        }
        .border_bottom_radius {
            border-bottom-left-radius: 3px;
            border-bottom-right-radius: 3px;
        }
        .main .form .label {
            height: 50px;
            line-height: 50px;
            color: #157dfb;
            text-indent: 0.8em;
            float: left;
            width: 95px;
        }
        .main .form .element {
            height: 50px;
            line-height: 50px;
            margin-left: 100px;
            display: block;
        }
        .main .form .element input {
            color: #666;
            font-family: "微软雅黑", serif;
            text-indent: 0.3em;
            border: 0;
            width: 98%;
            font-size: 1.0em;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }

        .main .btn:active {
            background-color: #3300ff;
            cursor: hand;
        }
        #result {
            min-height: 6em;
            margin: 10px 10px;
            line-height: 2;
            height: 2em;
            color: #837D7D;
        }
        .main .uptop {
            margin-top: -1.6em;
        }
        .main .form input {
            border: none;
            font-size: 1.1em;
            color: #a28d8d;
        }

        .main .searchbom {
            border: 1px solid rgb(182, 176, 176);
            border-bottom: none;
            border-bottom-left-radius: 0;
            border-bottom-right-radius: 0;
            margin-bottom: 0;
        }
        .main .other {
            border-radius: 0;
            margin-top: 0;
            margin-bottom: 0;

        }
        .main .searchtop {
            border-top-right-radius: 0;
            border-top-left-radius: 0;
            margin-top: 0;
            border-top: none;
        }
        #pol_station, #pol_office {
            display: none;
        }
        
        #btn_query {
        	text-decoration: none;
        }
        
        .tabbtn {
        	width: 100%;
        	margin: 0 0 15px 0 ;
        }
        
        #tapbtn_1, #tapbtn_2 {
        	height: 60px;
        	width: 49.8%;
        	border-bottom: 1px solid #dddddd;
        	border-left: none;
        	border-right: none;
        	border-top: none;
        }
        #tapbtn_1 {
        	margin-right: -2.5px;
        	background: #BBD6F2;
        	color:#fff;
        }
        #tapbtn_2 {
        	margin-left: -2.5px;
        	background: #FFFFFF;
        	color:#666;
        }
        .tabbtn span {
        	text-indent: 0.8em;
        	margin: 5px 7px 5px 7px;
        	font-family: "黑体";
        	font-size: 1.1em;
        	color:#666;
        }
        </style>
  </head>
  
  <body>
  	<div class="main" style="margin: 0;">
  		<div class="tabbtn" id="tabbtn">
  			<button id="tapbtn_1" onclick="changetab(1)">
  				<span>车辆违法查询</span>
  			</button>
  			<button id="tapbtn_2" onclick="changetab(2)">
  				<span>驾驶证违法查询</span>
  			</button>
  		</div>
	  	<div id="wzcx_car">
		    <div class="form">
		        <span class="label">车牌号</span><span style="width:15%;padding: 0;">辽</span>
		        <span class="element"><input id="idcard_case" name="CarId_one" class="no-border" type="text" maxLength="6" onkeyup="this.value=this.value.toUpperCase()" onfocus="hiden()"/></span>
		    </div>
		    <div class="form"  style="border-bottom-radius:3px;">
		        <span class="label">车架号</span>
		        <span class="element"><input id="accept_case" name="CarId_two" class="no-border" type="text" maxLength="7" onfocus="hiden()" placeholder="请输入您车架号后七位"/></span>
		    </div>
		    <div><a href="#" onclick="check(0)" id="btn_query" class="btn simple no-border">查 询</a></div>
		    <div id="toast" class="toast"></div>
	  	</div>
	  	<div id="wzcx_drive" style="display: none;">
	  		<div class="form">
		        <span class="label">驾驶证编号</span>
		        <span class="element"><input id="drive_license" name="drive_license" class="no-border" type="text" maxLength="18" onfocus="hiden()" placeholder="请输入驾驶证编号"/></span>
		    </div>
		    <div class="form">
		        <span class="label">档案编号</span>
		        <span class="element"><input id="fn" name="fn" class="no-border" type="text" maxLength="18" onfocus="hiden()" placeholder="请输入档案编号"/></span>
		    </div>
		    <div><a href="#" onclick="check(1)" id="btn_query" class="btn simple no-border">查 询</a></div>
		    <div id="toast" class="toast"></div>
	  	</div>
	</div>
  </body>
</html>
